-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GDScript: Improve error messages for invalid indexing #82639
GDScript: Improve error messages for invalid indexing #82639
Conversation
ed922d5
to
e9a7613
Compare
e9a7613
to
c6becd5
Compare
Should I edit the failing tests to accommodate the new error messages? |
Yep |
These errors are very common when using an invalid property name or calling on an object of the wrong type, and the previous message was a bit cryptic for users. Co-authored-by: Rémi Verschelde <[email protected]> Co-authored-by: golfinq <[email protected]>
c6becd5
to
5efbed5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-approved during the GDScript team meeting. Members of the team have been asked to check the PR and the errors formulation in order to make sure that they are correct, but for the most part, this seems like a great improvement.
This raises the question about Godot supporting global error codes, both in GDScript and in the Godot core itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These things are always hard to get your head around the wordings but they sound right and as an improvement to me 🎉
Thanks! |
Take over of #66948
Changes from the pull request are the addition of enums which specifies why the variant getter/setter failed, and changes the message to a more useful one on failure of getting/setting an index